#!/bin/bash

#######Begin: copy the patch module usbserial.ko to replace the orginal one for Fedora 11 crash bug################
if [ "$(cat /etc/issue |grep Fedora)" != "" -a "$(cat /etc/issue |grep 11)" != "" ]
then
		/sbin/modprobe -r option
		/sbin/modprobe -r usbserial
		if [ -f /opt/bakup/usbserial_orig.ko ]
		then
			rm -f /lib/modules/$(uname -r)/kernel/drivers/usb/serial/usbserial.ko
			mv 	/opt/bakup/usbserial_orig.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/usbserial.ko 
			rm -rf /opt/bakup
		fi
		/sbin/depmod -a
		/sbin/modprobe option
fi
#######End: copy the patch module usbserial.ko to replace the orginal one for Fedora 11 crash bug################


#######Begin: uninstall the patch kernel module hw_usb-storage for the SD no driver attached bug.################
if [ -f /lib/modules/$(uname -r)/kernel/drivers/usb/storage/hw_usb-storage.ko ]
then
	/sbin/rmmod -f hw_usb-storage
	rm -f /lib/modules/$(uname -r)/kernel/drivers/usb/storage/hw_usb-storage.ko
	/sbin/depmod -a
fi

#######End: uninstall the patch kernel module hw_usb-storage for the SD no driver attached bug.################
